object pj1 {
  trait Logger{
    def log(message:String): Unit ={
      println(message)
    }
  }

  class Calculator extends Logger {
    def add(x: Int, y: Int): Int = {
      var sum= x + y
      log(s"Adding $x and $y. Result: $sum")
      return sum

    }
    def subtract(x: Int, y: Int): Int = {
      var sub= x - y
      log(s"Subtracting $y from $x. Result: $sub")
      return sub
    }
    override def log(message: String): Unit = {
      println(message)
    }

  }


  def main(args: Array[String]): Unit = {
    val calculator=new Calculator
    val sum=calculator.add(8,6)
    val sub=calculator.subtract(8,6)

  }
}